#include "utils_md5.h"
#include "../debug.h"

#include <stdlib.h>
#include <string.h>

extern int g_isEnableDebug;

char *
utils_getMd5String(char *oriStr, int len)
{
	md5_state_t state;
	char md5[16];
	char *md5Str;

	md5Str = malloc(sizeof(char)*64);
	memset(md5Str, 0, sizeof(char)*64);

	md5_init(&state);
	md5_append(&state, (md5_byte_t*)oriStr, len);
	md5_finish(&state, (md5_byte_t*)md5);

	md5_sig2str(md5, md5Str, 64);
	log_info("%s", md5Str, strlen(md5Str));

	return md5Str;
}
